﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
namespace LinkViewer
{
    public class LinkWrapper : List<ILink>
    {
        public jcc.com.dailyez.Link Original_Link { get; set; }

        public string Title { get { return Original_Link.Title; } set { Original_Link.Title = value; } }
        public string URL { get { return Original_Link.URL; } set { Original_Link.URL = value; } }
        public int Status_Code { get; set; }

        public LinkWrapper()
        {
            IsChecked = false;
            Status_Code = -1;
        }

        public LinkWrapper(jcc.com.dailyez.Link link)
        {
            Original_Link = link;
            IsChecked = false;
            Status_Code = -1;
        }
        public bool IsChecked { get; set; }

        public void ReloadAll()
        {
            for (int i = 0; i < this.Count; i++)
            {
                DirectoryLink dirLink = new DirectoryLink();
                dirLink.Link = jcc.StandardWebService.WebService.GetLink(jcc.StandardWebService.GetKey(), this[i].ID);
                this[i] = dirLink;
            }
        }
    }
}
